package com.molin.threadTest.threadPoolTest;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Demo1 {
    public static void main(String[] args) throws InterruptedException {
        ExecutorService executorService= Executors.newCachedThreadPool();
//        ExecutorService executorService = Executors.newFixedThreadPool(10);
        executorService.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName()+"在执行了");
            }
        });
//        Thread.sleep(1000);
        executorService.submit(()->{System.out.println(Thread.currentThread().getName()+"在执行了");});

        executorService.shutdown();
    }
}
